package com.freejava.testactivemq.consumer;

import org.springframework.jms.annotation.JmsListener;
import org.springframework.stereotype.Component;

@Component
public class MyTopicConsumer {

    // 发布/订阅模式的消费者
    @JmsListener(destination = "${spring.activemq.topic-name}", containerFactory = "topicListener")
    public void getMessageFromActiveQueue(String message) {
        System.out.println("topic方式获取的消息是：" + message);
    }
}
